#include "find.h"

DlgFind::DlgFind(QWidget *parent, Qt::WFlags f)
    : QDialog(parent, f) {

    setObjectName(QString::fromUtf8("FindDialog"));
    resize(QSize(400, 98).expandedTo(minimumSizeHint()));
    gridLayout = new QGridLayout(this);
    gridLayout->setSpacing(6);
    gridLayout->setMargin(9);
    gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
    groupBox = new QGroupBox();
    groupBox->setObjectName(QString::fromUtf8("groupBox"));
    hboxLayout = new QHBoxLayout(groupBox);
    hboxLayout->setSpacing(6);
    hboxLayout->setMargin(9);
    hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
    rdoUp = new QRadioButton(groupBox);
    rdoUp->setObjectName(QString::fromUtf8("rdoUp"));

    hboxLayout->addWidget(rdoUp);

    rdoDown = new QRadioButton(groupBox);
    rdoDown->setObjectName(QString::fromUtf8("rdoDown"));

    hboxLayout->addWidget(rdoDown);


    gridLayout->addWidget(groupBox, 1, 2, 1, 1);

    chkCase = new QCheckBox(this);
    chkCase->setObjectName(QString::fromUtf8("chkCase"));

    gridLayout->addWidget(chkCase, 1, 0, 1, 2);

    chkWord = new QCheckBox(this);
    chkWord->setObjectName(QString::fromUtf8("chkWord"));

    gridLayout->addWidget(chkWord, 2, 0, 1, 2);

    txtFind = new QLineEdit(this);
    txtFind->setObjectName(QString::fromUtf8("txtFind"));

    gridLayout->addWidget(txtFind, 0, 1, 1, 2);

    label = new QLabel(this);
    label->setObjectName(QString::fromUtf8("label"));

    gridLayout->addWidget(label, 0, 0, 1, 1);

    vboxLayout = new QVBoxLayout();
    vboxLayout->setSpacing(6);
    vboxLayout->setMargin(0);
    vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
    cmdFind = new QPushButton(this);
    cmdFind->setObjectName(QString::fromUtf8("cmdFind"));

    vboxLayout->addWidget(cmdFind);

    cmdCancel = new QPushButton(this);
    cmdCancel->setObjectName(QString::fromUtf8("cmdCancel"));

    vboxLayout->addWidget(cmdCancel);

    spacerItem = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);

    vboxLayout->addItem(spacerItem);

    gridLayout->addLayout(vboxLayout, 0, 3, 2, 1);

    label->setBuddy(txtFind);
    setupStrings();
    QObject::connect(cmdFind, SIGNAL(clicked()), this, SLOT(accept()));
    QObject::connect(cmdCancel, SIGNAL(clicked()), this, SLOT(reject()));
}

void DlgFind::setupStrings() {
    setWindowTitle(tr("Find in Text"));
    groupBox->setTitle(tr("Direction"));
    rdoUp->setText(tr("&Up"));
    rdoDown->setText(tr("&Down"));
    chkCase->setText(tr("Match &case"));
    chkWord->setText(tr("Match whole &words"));
    label->setText(tr("&Find what:"));
    cmdFind->setText(tr("Find"));
    cmdCancel->setText(tr("&Cancel"));
}
